<?php

/**
 * Invoicedetails form base class.
 *
 * @method Invoicedetails getObject() Returns the current form's model object
 *
 * @package    billingSystem
 * @subpackage form
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrineFormGeneratedTemplate.php 29553 2010-05-20 14:33:00Z Kris.Wallsmith $
 */
abstract class BaseInvoicedetailsForm extends BaseFormDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'invid'             => new sfWidgetFormInputHidden(),
      'proid'             => new sfWidgetFormInputHidden(),
      'totnumpro'         => new sfWidgetFormInputText(),
      'totalmoneyproduct' => new sfWidgetFormInputText(),
      'comment'           => new sfWidgetFormTextarea(),
      'created_at'        => new sfWidgetFormDateTime(),
      'updated_at'        => new sfWidgetFormDateTime(),
    ));

    $this->setValidators(array(
      'invid'             => new sfValidatorChoice(array('choices' => array($this->getObject()->get('invid')), 'empty_value' => $this->getObject()->get('invid'), 'required' => false)),
      'proid'             => new sfValidatorChoice(array('choices' => array($this->getObject()->get('proid')), 'empty_value' => $this->getObject()->get('proid'), 'required' => false)),
      'totnumpro'         => new sfValidatorInteger(),
      'totalmoneyproduct' => new sfValidatorNumber(),
      'comment'           => new sfValidatorString(array('required' => false)),
      'created_at'        => new sfValidatorDateTime(),
      'updated_at'        => new sfValidatorDateTime(),
    ));

    $this->widgetSchema->setNameFormat('invoicedetails[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    $this->setupInheritance();

    parent::setup();
  }

  public function getModelName()
  {
    return 'Invoicedetails';
  }

}
